package cn.whut.glab.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import cn.whut.glab.domain.BD_Permission;
import cn.whut.glab.utils.DataSourceUtils;

public class PermissionDao {

	public List<BD_Permission> getAllPermission() throws SQLException {
		QueryRunner runner = new QueryRunner(DataSourceUtils.getDataSource());
		String sql = "select * from BD_Permission";
		return runner.query(sql, new BeanListHandler<BD_Permission>(BD_Permission.class));
	}	
}
